package com.bjb.vr.common.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.bjb.vr.common.dto.UmsAccount;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author admin
 * @description 针对表【ums_account(后台账户表)】的数据库操作Mapper
 * @createDate 2022-03-18 18:00:07
 * @Entity com.bjb.vr.common.dto.UmsAccount
 */
public interface UmsAccountMapper extends BaseMapper<UmsAccount>, MPJBaseMapper<UmsAccount> {

    @Select("select * from ums_account ${ew.customSqlSegment}")
    List<UmsAccount> selectByCondition(@Param(Constants.WRAPPER) Wrapper wrapper);

    List<UmsAccount> queryUserInfoByNameOrNickName(@Param("userName") String userName, @Param("nickName") String nickName);

    void updateAllAccountStatus(@Param("tenantId") String tenantId, @Param("status") Integer status);

    void updateUmsUserRole(@Param("newUserId") Long newUserId, @Param("oldUserId") Long oldUserId);

    void updateOldAccount(@Param("tenantId") String tenantId, @Param("userName") String username);

    void updateNewAccount(@Param("tenantId") String tenantId, @Param("userName") String userName, @Param("password") String password);

    void deleteUmsUserRoleByUserIdAndRoleId(@Param("userId") Long userId, @Param("roleId") Long roleId);

    void deleteUmsRoleByRoleId(@Param("roleId") Long roleId);
}




